#ifndef SHADER_H
#define SHADER_H

#include "Constants.h"

#include <GL/glew.h>
#include <GL/gl.h>

#include <string>

using std::string;

class Shader
{
public:

    explicit Shader();
    explicit Shader(const string& filename);
    ~Shader();

    bool init(const string& filename);
    unsigned int id() const;
    bool loadShaders(const string& filename);

    std::string getName() const;

private:

    // Disable copying.
    Shader(Shader const& rhs);
    Shader&operator=(Shader const& rhs);

    // Functions.
    char* readFile(const string& filename);
    bool isShaderOk(const GLuint shaderId);
    bool isProgramOk(const GLuint programId);

    // Variables.
    unsigned int m_shaderId;
    unsigned int m_vertexShader;
    unsigned int m_fragmentShader;

    string m_filename;
};

#endif // SHADER_H